package YAVMM::Host;
use Moose;
use MooseX::Storage;

our $VERSION = '0.01';

use YAVMM::Types;

with Storage ('format' => 'JSON');
with 'YAVMM::SortedAttributes';

has 'name' => (
    is       => 'rw',
    isa      => 'Str',
    required => 1,
);

has 'num_cpus' => (
    is       => 'rw',
#    isa      => 'PositiveInt',
    isa      => 'Int',
);

# in kB
has 'ram' => (
    is       => 'rw',
#    isa      => 'PositiveInt',
    isa      => 'Int',
);

has 'cluster' => (
    is       => 'rw',
    isa      => 'Str',
    default  => '',
);

sub TO_JSON { return $_[0]->pack; }

sub sorted_attributes { return $_[0]->_sort_attributes(['name']); }

__PACKAGE__->meta->make_immutable;
1;
